package pure.engine.model.sections 
{

	/**
	 * 片段动作
	 * 
	 * @author ＃Pure
	 */
public final class Action 
{
	public function Action(name:String, group:Vector.<int>, frameRate:int = 0 )
	{
		this.name = name;
		this.group = group;
		var len:int = this.group.length;
		// 多帧
		if (len > 1 ) 
		{
			if (frameRate <= 0)
			{
				throw new Error('Action［'+this.name+'］ - 非单帧动作，frameRate不可小于0');
			}
			
			delay = 1000.0 / frameRate;
		}
		// 单帧
		else
		{
			delay = 0;
		}
	}
	
	
    public var name:String;
    public var group:Vector.<int>;
    public var delay:Number;

}

}